<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件监听</title>
</head>
<body>

<ul id="no">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li>7</li>
</ul>

<script>
    // write your code here
    // ......
    var obj = document.getElementsByTagName("li");
    for (var i = 0; i < obj.length; i++) {
        obj[i].onclick = function () {
            alert(this.innerHTML);
        }
    }
</script>
</body>
</html>